<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/page/share/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>人员显示</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<link rel="stylesheet" href="/css/modules.css" type="text/css"
			media="screen" />
		<link rel="stylesheet" href="/css/modules1.css" type="text/css"
			media="screen" />
		<!--Internet Explorer Trancparency fix-->
		<!--[if IE 6]>
    <script src="/js/ie6pngfix.js"></script>
    <script>
    DD_belatedPNG.fix('#head, a, a span, img, .message p, .click_to_close, .ie6fix');
    </script>
    <![endif]-->
		<script type='text/javascript' src="/js/jquery-1.4.2.min.js"></script>
		<script type='text/javascript' src="/js/jquery.js"></script>
		<script type='text/javascript' src="/js/jquery-ui.js"></script>
		<script type='text/javascript' src="/js/jquery.wysiwyg.js"></script>
		<script type='text/javascript' src="/js/custom.js"></script>
		<script type='text/javascript' src="/js/jquery-1.4.2.min.js"></script>
		<script language="JavaScript">
		$(function(){
			$("#provincespan").load("/area/province!getProvince.action");
		});
		function loadCity(f){
			var provinceid=$(f).val();
			$("#cityspan").load("/area/province!getCity.action?provinceid='"+provinceid+"'");
			$("#regionspan").html("");
			$(f).attr("name","provinceid");
		//	$("#psel").attr("name","ff.dd");
		}
		
		function loadRegion(f){
			var cityid=$(f).val();
			$("#regionspan").load("/area/province!getRegion.action?cityid='"+cityid+"'");
			$("#psel").attr("name","");
			$(f).attr("name","provinceid");
		//	$("#csel").attr("name","");
		}

		function zz(f){
			
			$("#csel").attr("name","");
			$(f).attr("name","provinceid");
		//	$("#csel").attr("name","");
		}
		
		
		
		
<!--
	//到指定的分页页面
	function topage(page){
		var form = document.forms[0];
		form.page.value=page;
		form.submit();
	}
/**
	function allSelect(){
		var form = document.forms[0];
		var state = form.allselectbox.checked;
		var length = form.ids.length;
		if(length){
			for(var i=0;i<length;i++){
				form.ids[i].checked=state;
			}
		}else{
			form.ids.checked=state;
		}
	}
*/	
	function allSelect(element){
		if(element.value=="选中全部"){
			$(":checkbox").attr("checked",true);
			element.value="取消全选";
		}else{
			$(":checkbox").attr("checked",false);
			element.value="选中全部";
		}
		
		
	
	}
	function _action(methodName){
		if(selectItem()){
		alert("dd");
			var form = document.forms[3];
			if(methodName=="enable")
				form.action='<s:url action="UserManage!enable"/>';
			else 
				form.action='<s:url action="UserManage!disable"/>';
			form.submit();
		}else{
			alert("请选择要操作的记录");
		}
	}
	function selectItem(){
		var form = document.forms[3];
		var length = form.ids.length;
		if(length){
			for(var i=0;i<length;i++){
				if(form.ids[i].checked) return true;
			}
		}else{
			return form.ids.checked;
		}
		return false;
	}
	
-->
</script>
		<script type="text/javascript" src="/js/FoshanRen.js"></script>
	</head>
	<body style="background-color: transparent">
		<h2 class="jquery_tab_title">
			人员列表
			<span style="float:right;">
			<s:form action="UserManage!userQuery.action" method="post">
  				<input type="text" name="queryString" class="input-medium" value="请输入姓名/手机号码" 
  					onblur="if (this.value =='') this.value='请输入姓名/手机号码'" 
	  				 onclick="if (this.value=='请输入姓名/手机号码')this.value=''"/>
  				<input type="submit" value="查询" class="button" />
  			</s:form>
  			</span>
		</h2>
		<div>
		<buyou:permission privilege="listByArea" module="user">	
			<s:form action="UserManage!list.action" method="post"
				cssStyle="padding-bottom:10px;text-align:right;">
				<table id="noborder_table">
					<tr>
						<td id="areaSelect">
							<span id="provincespan"> </span>
							<span id="cityspan"> </span>
							<span id="regionspan"> </span>
						</td>
						<td>
							<input type="submit" class="button" value="按区域查询" />
						</td>
					</tr>
				</table>
			</s:form>
		</buyou:permission>
			<s:form id="easyOp" action="UserList" method="post">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<th class="th_first">
							&nbsp;
						</th>

						<th>
							姓名
						</th>
						<th>
							账号
						</th>
						<th>
							性别
						</th>
						<th>
							电子邮件
						</th>
						<th>
							部门
						</th>
						<th>
							管理区域
						</th>
						<th>
							角色
						</th>
						<th>
							状态
						</th>
						<th>
							修改
						</th>
						<buyou:permission privilege="userManage" module="system">
						<th>
							设置权限
						</th>
						</buyou:permission>
					</tr>
					<s:iterator value="userList">
						<tr>
							<td class="td_first">
								<INPUT TYPE="checkbox" name="ids"
									value="<s:property value="id"/>">
									<td>
										${realname }
									</td>
									<td>
										${phone }
									</td>
									<td>
										${gender.name }
									</td>
									<td>
										<s:property value="email" />
									</td>
									<td>
										${department.name }
									</td>
									<td>
										<s:iterator value="provinces">
											<s:if test="fullAddress==null">
												<s:property value="name" />
											</s:if><s:else>
											<s:property value="fullAddress" />
											</s:else>
											
										</s:iterator>
									</td>
							<td>
								${role.name }
							</td>
							<td>
								<s:if test="visible">
									<font color=green>启用</font>
								</s:if>
								<s:else>
									<font color=red>禁用</font>
								</s:else>
							</td>
							<td>
							<buyou:permission privilege="update" module="user">	
								<a
									href='<s:url action="UserManage!editUser" />?userid=<s:property value='id'/>' />
								<img src="/images/edit.gif" width="15" height="16" border="0" />
									</a></buyou:permission>
							</td>
							<buyou:permission privilege="privilegeGroupSet" module="user">	
							<td>&nbsp;
								<a
									href="<s:url action='UserManage!privilegeGroupSetUI'/>?userid=<s:property value='id'/>">设置权限</a>
							</buyou:permission>
							</td>
						</tr>
					</s:iterator>

				</table>
			</s:form>
		</div>
		<div id="toolnav">
			<span style="float: left;"> 
			<input type="button" class="button" value="选中全部" onclick="javascript:allSelect(this)"
					name="allselectbox" />
			<buyou:permission privilege="insert"	module="user">
				<input type="button" class="button"	onClick="javascript:window.location.href='<s:url action="UserManage!addUser"/>'"
						value="添加员工">
			</buyou:permission> 
			<buyou:permission privilege="update" module="user">
				<input type="button" value=" 启 用 " class="button"	onclick="javascript:_action('enable')">
				<input type="button" value=" 禁 用 " class="button"	onclick="javascript:_action('disable')">
			</buyou:permission> 
			</span>
			<span style="float: right;"> 
				<s:property	value="#request.pagination" escape="false" /> 
			</span>
			<div style="clear: both"></div>
		</div>
	</body>
</html>